import { List, Map } from 'immutable'

const defaultState = Map({
    detail:null,
    common:null
})

const reducer = (state=defaultState,action)=>{
     if(action.type === 'LOAD_DETAIL_DATA'){
        //  console.log('111')
         return state.setIn(['detail'], action.all)
     }
     if(action.type === 'LOAD_COMMON_DATA'){
        //  console.log('222');
        //  return {
        //      common:action.common
        //  }
        return state.setIn(['common'], action.common)
     }
     return state
}

export default reducer